package com.aau.edu.design.singleton;
//懒汉式写法
public class LazySingleton {

    private static LazySingleton instance = null;//静态私有成员变量

    //私有构造函数
    private LazySingleton() {

    }

    //静态工厂方法，返回唯一实例
    public static  LazySingleton getInstance() {
        if (instance == null) {
            instance = new LazySingleton();
        }
        return instance;
    }
}
